package com.zcg.blogger.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zcg.blogger.dao.MessageDao;
import com.zcg.blogger.dao.ProposeDao;
import com.zcg.blogger.model.Message;
import com.zcg.blogger.model.Propose;
import com.zcg.blogger.pojo.Pager;
import com.zcg.blogger.service.MessageService;
import com.zcg.blogger.service.ProposeService;

@Service("proposeService")
public class ProposeServiceImpl implements ProposeService{

	@Resource
	private ProposeDao proposeDao;

	@Override
	public void add(Propose propose) {
		proposeDao.insert(propose);
	}

	@Override
	public List<Propose> loadProposeAll() {
		Map map = new HashMap();
		map.put("pageOffset", Pager.getPager().getPageOffset());
		map.put("pageSize", Pager.getPager().getPageSize());
		return proposeDao.selectAll(map);
	}

	@Override
	public int countAll() {
		return proposeDao.countAll();
	}

}
